package gr.uop.cst.context.adaptation.artifacts.oom;

import gr.uop.cst.context.adaptation.Action;
import java.lang.reflect.Field;

/**
 *
 * @author Ioannis Bourlakos <mi49@uop.gr>
 */
public abstract class AbstractFieldAdaptation extends AbstractMemberAdaptation<Field> {
    
    protected AbstractFieldAdaptation(String className, String fieldName, Action action) throws ClassNotFoundException, NoSuchFieldException {
        this(Class.forName(className).getDeclaredField(fieldName), action);
    }
    protected AbstractFieldAdaptation(Field f, Action action) {
        super(f,action);
    }
    
    public Field getMember() throws ClassNotFoundException, NoSuchFieldException {
        return Class.forName(getClassName()).getDeclaredField(getMemberName());
    }
    
    public Field getField() throws ClassNotFoundException, NoSuchFieldException {
        return getMember();
    }
    
}
